A personal computer (PC) is generally fitted with a parallel port, usually designated LPT1, which enables the PC to communicate with a peripheral device. The most common use for the parallel port is for transferring data from the PC to an attached printer. In a typical configuration, such as what one would expect to find in a standard shipping Windows.RTM.95 system, an application would transfer data to a printer by interfacing with a print driver (LPT.VXD) that in turn communicates with the parallel port. This print driver effectively "owns" the parallel port. In other words, the parallel port is dedicated to printer traffic, and cannot be used for any other purpose absent a system reconfiguration.
In some circumstances, it is desirable to be able to use the parallel port for more than one type of traffic. An example of such a circumstance is where a user wishes to attach an auxiliary external disk drive to his or her PC. Such external disk drives, like the omega Zip.RTM. drive, are designed to be connected to the parallel port of a PC. If, as is usually the case, the user also wishes to have a printer connected to the PC, the printer may be connected to a separate parallel port on the Zip.RTM. drive itself. In such a configuration, the parallel port on the PC must therefore be capable of use for two different purposes: passing data between the PC and the Zip.RTM. drive (for example, saving and retrieving files), and passing data between the PC and the printer.
In order to achieve this shared use of the parallel port, omega adapted an existing Windows.RTM.95 facility for supporting a facility called Port Contention Handling. See Microsoft Windows.RTM.95 Device Developer Kit Design Guide, "Virtual Communication Driver" (January 1988). The Port Contention Handling scheme involves a sharing mechanism in which a port arbitration driver, designated VCOMM.VXD, controls access to the parallel port. When data is to be transferred to either the printer or the Zip.RTM. drive through the parallel port, an associated driver on the host (LPT.VXD or IOMEGA.VXD, respectively) queries VCOMM.VXD for the capabilities of the parallel port. If the parallel port is sharable, the respective associated driver will issue a request to the port arbitration driver for permission to send data to the parallel port (typically referred to as "Acquiring" or "Stealing" the port). Once the port has been Acquired or Stolen, the particular peripheral device can directly interface with the I/O (input/output) registers associated with the parallel port, thereby enabling data to be passed between the host and that particular peripheral device (assuming the particular peripheral device supports a "pass-thru" connection architecture).
There are at least two major problems with the foregoing approach to parallel port sharing. First, the duration of the Acquire/Steal is unpredictable, resulting in a potential for data loss by one process if the other process takes too long to release the parallel port, leading to a potential depletion of buffer space. More significantly, since the port arbitration driver interface is relatively new, some major printer manufacturers, such as Hewlett-Packard and Canon, do not yet configure their print drivers to interface with VCOMM.VXD. For example, both Hewlett-Packard and Canon provide print drivers for Windows.RTM. environments that are configured as DLLs (Dynamic Link Libraries) that interface directly with the I/O registers of the parallel port, without regard to the existence of a port arbitration driver. Thus, where VCOMM.VXD is used in a Port Contention Handling arrangement for parallel port sharing, the parallel port may be Acquired/Stolen away from the printer at the VCOMM.VXD level, but the print driver DLL may nevertheless "wake-up" and interface directly to the parallel port in an effort to communicate with the printer. The result is an I/O port sharing conflict, since the Port Contention Handling driver (for example, IOMEGA.VXD) will still have control of the parallel port. This problem can be readily demonstrated by installing a Zip.RTM. drive and connecting a Hewlett-Packard DeskJet printer to the Zip.RTM. drive. A conflict will typically arise when an attempt is made to print a file that resides on the Zip.RTM. drive to the attached printer.
In view of the foregoing problems, known approaches do not provide a satisfactory solution to the problem of parallel port sharing. Accordingly, there is a need for a method and apparatus enabling the shared use of a parallel port of a device such as a PC. More specifically, such a method and apparatus should enable the parallel port to be used for at least two different types of traffic, such as network traffic and printer traffic, without creating a conflict for control of the parallel port.